home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / gs24src.zip / GXIMAGE.H < prev    next >
C/C++ Source or Header  |  1992-02-13  |  3KB  |  79 lines

  1. /* Copyright (C) 1989, 1990, 1991, 1992 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* gximage.h */
  21. /* Internal definitions for image rendering */
  22. /* Requires gxcpath.h, gxdevmem.h, gzcolor.h, gzpath.h */
  23.  
  24. /* Imaging state structure */
  25. /* The Unix C compiler can't handle typedefs for procedure */
  26. /* (as opposed to pointer-to-procedure) types, */
  27. /* so we have to do it with a macro instead: */
  28. #define iunpack_proc_args\
  29.     P5(gs_image_enum *, byte *, byte *, uint, uint)
  30. #define irender_proc_args\
  31.     P4(gs_image_enum *, byte *, uint, int)
  32. /* Main state structure */
  33. struct gs_image_enum_s {
  34.     /* Following are set at structure initialization */
  35.     int width;
  36.     int height;
  37.     int bps;            /* bits per sample: 1, 2, 4, 8, 12 */
  38.     int spp;            /* samples per pixel: 1, 3, or 4 */
  39.     int spread;            /* spp if colors are separated, */
  40.                     /* 1 otherwise */
  41.     int masked;            /* 0 = [color]image, 1 = imagemask */
  42.     fixed fxx, fxy, fyx, fyy;    /* fixed version of matrix */
  43.     void (*unpack)(iunpack_proc_args);
  44.     int (*render)(irender_proc_args);
  45.     gs_state *pgs;
  46.     gs_fixed_rect clip_box;        /* pgs->clip_path.path->bbox, */
  47.                     /* possibly translated */
  48.     gs_int_rect ibox;        /* integer version of clip_box, */
  49.                     /* only used for direct/buffered */
  50.     byte *buffer;            /* for expanding to 8 bits/sample */
  51.     uint buffer_size;
  52.     uint bytes_per_row;        /* # of input bytes per row */
  53.                     /* (per plane, if spp == 1 and */
  54.                     /* spread > 1) */
  55.     int never_clip;            /* true if entire image fits */
  56.     int skewed;            /* true if image is skewed */
  57.                     /* or rotated */
  58.     int slow_loop;            /* true if !(skewed | non-rect clip */
  59.                     /* | imagemask with a halftone) */
  60.     fixed adjust;            /* adjustment when rendering */
  61.                     /* characters */
  62.     ulong _ds *map4to32;        /* expansion map for monobit images */
  63.     gx_device_clip clip_dev;    /* clipping device (if needed) */
  64.     /* Following are updated dynamically */
  65.     byte *planes[4];        /* separated color data */
  66.     int plane_index;        /* current plane index, [0..spp) */
  67.     uint plane_size;        /* size of data in each plane */
  68.     uint byte_in_row;        /* current input byte position in row */
  69.     fixed xcur, ycur;        /* device x, y of current row */
  70.     int yci, hci;            /* integer y & height of row */
  71.                     /* (if no skew) */
  72.     int y;
  73.     /* Entries 0 and 255 of the following are set at initialization */
  74.     /* for monochrome images; other entries are updated dynamically. */
  75.     gx_device_color dev_colors[256];
  76. #define icolor0 dev_colors[0]
  77. #define icolor1 dev_colors[255]
  78. };
  79.